/**
 * Song class to hold all the attributes of a song
 *
 * @copyright  hoatle (hoatle.net)
 * @author     hoatle
 * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
 * @version    1.0-alpha
 * @link       http://hoatle.net/Project-Music-Engine
 * @since      Class available since Release 1.0-alpha
 * $Id: Song.js 4 2009-01-16 12:03:30Z hoatlevan $
 */

/**
  * class Song
  * 
  * Class Constructor
  *
  * @param opt_params MAP
  * @return Song
  */

Song = function(opt_params) {
    this._init(opt_params);
    return this;
}


/**
 * _init sets all Song attributes to their default value. Make sure to call this
 * method within your class constructor
 */
Song.prototype._init = function(opt_params) {

    /**
     * Song Name
     */
    this.name = "";
    /**
     * Song Artist/ Singer Name
     */
    this.artName = "";
    /**
     * Song Album Name
     */
    this.album = "";
    /**
     * Song Duration (Time: mins)
     */
    this.duration = 0;
    /**
     * Song BitRate (Kb/s)
     */
    this.bitRate = 0;
    /**
     * Song Size (Mb)
     */
    this.size = 0;
    /**
     * Song Link (can be any protocol: http, file:...) Mostly http
     */
    this.link = "";
    /**
     * Song from which contry name
     */
    this.ctName = "";
    /**
     * Song Source Name - The source of the song from which music sites in the Internet
     */
    this.srcName = "";
    /**
     * user name who contribute to music-engine dababase, currrently just default as "system"
     */
    this.uName = "system";
    /**
     * Song Writer Name
     */
    this.swName = "";

    /**Aggregations: */

    /**Compositions: */
}

/**
 * Whether is song is Valid or Not
 * To be valid, at list the song has to include link + name
 *
 * @return true if valid or else false
 */
Song.prototype.isValid = function() {
    if (this.name === '' && this.link == '') {
        return false;
    }
    return true;
}


/**
 * 
 * @param songMap
 * an Map of Song attribute and value to set Song Attribute. Return true when
 * succeeded or else false
 *
 * @return true or false
 */
Song.prototype.set = function(params) {
 
}
